package com.seanchenxi.gwt.wordpress.xmlrpc.service.local.impl;

import com.seanchenxi.gwt.wordpress.xmlrpc.service.MetaWeblogServiceAsync;
import com.seanchenxi.gwt.wordpress.xmlrpc.service.impl.MetaWeblogServiceAsyncImpl;

/**
 * The Class MetaWeblogLocalServiceAsyncWrapper.
 */
abstract class MetaWeblogLocalServiceAsyncWrapper extends
		LocalServiceWrapper {

	/** The meta weblog servie. */
	MetaWeblogServiceAsync metaWeblogServie = null;

	/**
	 * Instantiates a new meta weblog local service async wrapper.
	 * 
	 * @param url
	 *            the xmlrpc's url
	 * @param wpUserName
	 *            the wp user name
	 * @param wpPassword
	 *            the wp password
	 */
	public MetaWeblogLocalServiceAsyncWrapper(String url, String wpUserName,
			String wpPassword) {
		super();
		assert (url != null && url.length() > 7);
		assert (wpUserName != null && wpUserName.trim().length() > 0
				&& wpPassword != null && wpPassword.trim().length() > 0);

		metaWeblogServie = new MetaWeblogServiceAsyncImpl(url);

		assert (metaWeblogServie != null);

		setWpUser(wpUserName, wpPassword);
	}

	/**
	 * Gets the meta weblog servie.
	 * 
	 * @return the meta weblog servie
	 */
	protected MetaWeblogServiceAsync getMetaWeblogServie() {
		return metaWeblogServie;
	}

}
